import { h,ref } from "vue";
import { render } from "@/utils";
import LinkText from "@/components/LinkText/index.vue";

export const columns = [
  {
    title: "名称",
    dataIndex: "name",
    fixed: "left",
    width: 260,
    render: ({ record }) =>h(LinkText, { label: record?.name, desc:record?.templateAlias,max_width: "240px"}),
  },
  {
    title: "客户操作系统",
    dataIndex: "os",
    tooltip: true,
    ellipsis: true,
    width: 240,
    render,
  },
  {
    title: "CPU",
    dataIndex: "cpuCores",
    width: 100,
  },
  {
    title: "内存",
    dataIndex: "memory",
   width: 100,
  },
  {
    title: "磁盘容量",
    slotName: "disk",
     width: 200,
  },
  {
    title: "所属集群",
    dataIndex: "cluster",
    tooltip: true,
    ellipsis: true,
    width: 240,
    render: ({ record }) => record?.relationClusters?.map(item=>item?.name)?.join(","),
    },
  {
    title: "最近时间",
    dataIndex: "updateTime",
    width: 180,
    render,
  },
  {
    title: "操作",
    width: 120,
    dataIndex: "action",
    fixed: "right",
    slotName: "action",
  },
]
